home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODF-Interest Archive / June 96 / Re Scripting < prev    next >
Encoding:
Internet Message Format  |  1996-12-03  |  2.0 KB  |  [TEXT/ttxt]

  1. Subject:     Re:Scripting
  2. Sent:        6/27/96 9:26 AM
  3. Received:    6/27/96 9:40 AM
  4. From:        Greg Friedman, friedman@cognosis.com
  5. Reply-To:    ODF Interest, ODF-Interest@CILabs.ORG
  6. To:          OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
  7.  
  8. At 2:30 PM 6/27/96, Stephane SILVESTRE wrote:
  9.  
  10. > I've wanted to make my part scriptable, but it seems like my dictionnary
  11. > isn't recognized by the Script Editor. I always get a syntax error
  12. > "expected class name but got identifier" but if I open the part's
  13. > dictionnary, my class is well defined. Have I missed something ?
  14.  
  15. For the Script Editor to compile a script against your dictionary, you must
  16. have an instance of your part up and running. You must specify the running
  17. part in the "tell" block of the script.
  18.  
  19. For example, if your part editor is called SurfWriter, create a new
  20. document called "SurfWriter Sample". Save the document and reopen it. This
  21. is necessary because the first time you create a document, the name of the
  22. document is out of synch its process name. With your document open, type:
  23.  
  24. tell application "SurfWriter Sample"
  25.         ...
  26. end tell
  27.  
  28. When you double-click your document to open it, a small application called
  29. the OpenDoc Launcher actually launches and then sub-launches your document.
  30. Make sure you wait for the OpenDoc Launcher to quit before attempting to
  31. compile your script. If you don't wait, your script will be compiled
  32. against the launcher, instead of against your part.
  33.  
  34. > PS: as Mark Lanett, I would very appreciate a simple extension example
  35. > showing one server and one client parts.
  36.  
  37. This is in the works. I wrote a simple extension called "ColorExtension".
  38. It has two methods, SetForeColor and SetBackColor. It has clearly-defined
  39. API's for clients and servers, and should serve as a good model for writing
  40. extensions. We'll try to get it out on the net next week.
  41.  
  42. gsf.
  43.  
  44.  
  45. _________________________________________________________
  46. Greg Friedman      ODF Engineering       Apple Computer
  47.  
  48.